﻿namespace Sidvall.UI.Entities
{
    public class ChartItemCollection : BusinessBaseCollection<ChartItem>
    {
        #region Public Members

        #region Add

        public ChartItem Add(string name, string seriesTitle, string verticalAxisTitle, ChartItemData chartItemData)
        {
            var item = new ChartItem()
            {
                Name = name,
                SeriesTitle = seriesTitle,
                VerticalAxisTitle = verticalAxisTitle,
                ChartItemData = chartItemData,
            };
            Add(item);
            return item;
        }

        #endregion
        #region AddEmptyItem

        public void AddEmptyItem()
        {
            Add(string.Empty, string.Empty, string.Empty, null);
        }

        #endregion

        #endregion
        #region Factory Members

        #region GetChartItems

        public static ChartItemCollection GetChartItems(int count)
        {
            var chartItems = new ChartItemCollection();
            for (int i = 0; i < count; i++)
                chartItems.AddEmptyItem();
            return chartItems;
        }

        #endregion

        #endregion
        #region Constructors

        public ChartItemCollection()
        {
        }

        #endregion
    }
}
